Dynomotion

Group: DynoMotion Message: 2639 From: bradodarb Date: 12/7/2011
Subject: Master Homing Program
Hello Tom,


What is the best way to detect encoder edges while homing?

I wanted to offer methods for rising and falling.

Thank you,

Brad Murry
Group: DynoMotion Message: 2640 From: Tom Kerekes Date: 12/7/2011
Subject: Re: Master Homing Program
Hi Brad,
 
Not sure what you mean as I'm sure you know this but:
 
int Polarity= 1;  /// set to 1 to wait for a rising edge or 0 to wait for a falling edge
 
while (ReadBit(xx) != Polarity) ;   // wait for the desired polarity level
 
Regards
TK

Group: DynoMotion Message: 2641 From: Brad Murry Date: 12/7/2011
Subject: Re: Master Homing Program

It’s just not natural for me that kflop/kanalog/snapamps handles encoders on it’s GPIO.  I’m used to using separate methods for encoders on other controllers because most devices the IO is not fast enough.

 

I wasn’t sure if there were secret methods for it.

 

-Brad

 

 

From: DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com] On Behalf Of Tom Kerekes
Sent: Wednesday, December 07, 2011 3:35 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] Master Homing Program

 

 

Hi Brad,

 

Not sure what you mean as I'm sure you know this but:

 

int Polarity= 1;  /// set to 1 to wait for a rising edge or 0 to wait for a falling edge

 

while (ReadBit(xx) != Polarity) ;   // wait for the desired polarity level

 

Regards

TK

 

From: bradodarb <bradodarb@...>
To: DynoMotion@yahoogroups.com
Sent: Wednesday, December 7, 2011 2:29 PM
Subject: [DynoMotion] Master Homing Program

 

Hello Tom,

What is the best way to detect encoder edges while homing?

I wanted to offer methods for rising and falling.

Thank you,

Brad Murry

 

Group: DynoMotion Message: 2642 From: himykabibble Date: 12/7/2011
Subject: Re: Master Homing Program
Brad,

"I wasn't sure if there were secret methods for it." - Even if there are, he won't be able to tell you - they're SECRET!!! :-)

Regards,
Ray L.

--- In DynoMotion@yahoogroups.com, Brad Murry <bradodarb@...> wrote:
>
> It’s just not natural for me that kflop/kanalog/snapamps handles encoders on it’s GPIO. I’m used to using separate methods for encoders on other controllers because most devices the IO is not fast enough.
>
>
>
> I wasn’t sure if there were secret methods for it.
>
>
>
> -Brad
>
>
>
>
>
> From: DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com] On Behalf Of Tom Kerekes
> Sent: Wednesday, December 07, 2011 3:35 PM
> To: DynoMotion@yahoogroups.com
> Subject: Re: [DynoMotion] Master Homing Program
>
>
>
>
>
> Hi Brad,
>
>
>
> Not sure what you mean as I'm sure you know this but:
>
>
>
> int Polarity= 1; /// set to 1 to wait for a rising edge or 0 to wait for a falling edge
>
>
>
> while (ReadBit(xx) != Polarity) ; // wait for the desired polarity level
>
>
>
> Regards
>
> TK
>
>
>
> From: bradodarb <bradodarb@...>
> To: DynoMotion@yahoogroups.com
> Sent: Wednesday, December 7, 2011 2:29 PM
> Subject: [DynoMotion] Master Homing Program
>
>
>
> Hello Tom,
>
> What is the best way to detect encoder edges while homing?
>
> I wanted to offer methods for rising and falling.
>
> Thank you,
>
> Brad Murry
>
Group: DynoMotion Message: 2643 From: bradodarb Date: 12/7/2011
Subject: Re: Master Homing Program
haha

Well he did try to keep "GetStopState" under wraps, so you just never know.

Then there is the top secret KStep device that is camouflaged as a Kanalog.

Makes you wonder whats really going on....

-Brad

--- In DynoMotion@yahoogroups.com, "himykabibble" <jagboy@...> wrote:
>
> Brad,
>
> "I wasn't sure if there were secret methods for it." - Even if there are, he won't be able to tell you - they're SECRET!!! :-)
>
> Regards,
> Ray L.
>
> --- In DynoMotion@yahoogroups.com, Brad Murry <bradodarb@> wrote:
> >
> > It’s just not natural for me that kflop/kanalog/snapamps handles encoders on it’s GPIO. I’m used to using separate methods for encoders on other controllers because most devices the IO is not fast enough.
> >
> >
> >
> > I wasn’t sure if there were secret methods for it.
> >
> >
> >
> > -Brad
> >
> >
> >
> >
> >
> > From: DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com] On Behalf Of Tom Kerekes
> > Sent: Wednesday, December 07, 2011 3:35 PM
> > To: DynoMotion@yahoogroups.com
> > Subject: Re: [DynoMotion] Master Homing Program
> >
> >
> >
> >
> >
> > Hi Brad,
> >
> >
> >
> > Not sure what you mean as I'm sure you know this but:
> >
> >
> >
> > int Polarity= 1; /// set to 1 to wait for a rising edge or 0 to wait for a falling edge
> >
> >
> >
> > while (ReadBit(xx) != Polarity) ; // wait for the desired polarity level
> >
> >
> >
> > Regards
> >
> > TK
> >
> >
> >
> > From: bradodarb <bradodarb@>
> > To: DynoMotion@yahoogroups.com
> > Sent: Wednesday, December 7, 2011 2:29 PM
> > Subject: [DynoMotion] Master Homing Program
> >
> >
> >
> > Hello Tom,
> >
> > What is the best way to detect encoder edges while homing?
> >
> > I wanted to offer methods for rising and falling.
> >
> > Thank you,
> >
> > Brad Murry
> >
>
Group: DynoMotion Message: 2704 From: dynomotosaurus Date: 12/12/2011
Subject: Re: Master Homing Program
KStep? Camouflaged Links? [waves hand] "These are not the Boards you are
looking for..."

Regarding the Edge detection, isn't the while loop just looking for the
configured input to be in the desired On/Off State? Meaning any time
that code runs (regardless of edge transition) if the input is in the
desired state the while loop will pass though to the next line even if
it is still active from the previous while loop test.

I did something similar in a different device (Machine Vision Smart
Camera [PPT Impact]) where I needed to detect rising edge and falling
edge transitions on regular boolean values set over Modbus (regular
inputs had RE and FE event triggers, but Modbus Registers do not), I
wanted a single output that was true for one execution pass but false on
subsequent passes if the monitored input transitioned from false to
true, and remained true. All I did was to replicate the functionality
of the IEC 61131-3 R_Trig and F_Trig functions (which I use daily on PLC
and other Motioncontroller systems we work with here).

Basically you need an Input [Clk] (physical , or boolean variable) you
want to monitor, an output [Q] (physical, or boolean variable), and a
temporary boolean [LastClk] variable that can remember the previous
Input state.

R_Trig works like so...
Q=Clk & (!LastClk);
LastClk=Clk;

F_Trig...
Q=LastClk & (!Clk);
LastClk=Clk;

Granted the code as presented would require unique named Q/Clk/LastClk
for each different Input and output state, but could be easily converted
to function call where you pass the input/bool the desired index you
want it assigned to, and a reference to an array of structures (if you
want to maintain RE/FE states for multiple inputs). The array structure
index would be used to reference the Q output for one shot execution in
a flow control block (if/while, etc).



Best Regards,

Patrick


--- In DynoMotion@yahoogroups.com, "bradodarb" <bradodarb@...> wrote:
>
> haha
>
> Well he did try to keep "GetStopState" under wraps, so you just never
know.
>
> Then there is the top secret KStep device that is camouflaged as a
Kanalog.
>
> Makes you wonder whats really going on....
>
> -Brad
>
> --- In DynoMotion@yahoogroups.com, "himykabibble" jagboy@ wrote:
> >
> > Brad,
> >
> > "I wasn't sure if there were secret methods for it." - Even if there
are, he won't be able to tell you - they're SECRET!!! :-)
> >
> > Regards,
> > Ray L.
> >
> > --- In DynoMotion@yahoogroups.com, Brad Murry <bradodarb@> wrote:
> > >
> > > It’s just not natural for me that kflop/kanalog/snapamps
handles encoders on it’s GPIO. I’m used to using separate
methods for encoders on other controllers because most devices the IO is
not fast enough.
> > >
> > >
> > >
> > > I wasn’t sure if there were secret methods for it.
> > >
> > >
> > >
> > > -Brad
> > >
> > >
> > >
> > >
> > >
> > > From: DynoMotion@yahoogroups.com
[mailto:DynoMotion@yahoogroups.com] On Behalf Of Tom Kerekes
> > > Sent: Wednesday, December 07, 2011 3:35 PM
> > > To: DynoMotion@yahoogroups.com
> > > Subject: Re: [DynoMotion] Master Homing Program
> > >
> > >
> > >
> > >
> > >
> > > Hi Brad,
> > >
> > >
> > >
> > > Not sure what you mean as I'm sure you know this but:
> > >
> > >
> > >
> > > int Polarity= 1; /// set to 1 to wait for a rising edge or 0 to
wait for a falling edge
> > >
> > >
> > >
> > > while (ReadBit(xx) != Polarity) ; // wait for the desired polarity
level
> > >
> > >
> > >
> > > Regards
> > >
> > > TK
> > >
> > >
> > >
> > > From: bradodarb <bradodarb@>
> > > To: DynoMotion@yahoogroups.com
> > > Sent: Wednesday, December 7, 2011 2:29 PM
> > > Subject: [DynoMotion] Master Homing Program
> > >
> > >
> > >
> > > Hello Tom,
> > >
> > > What is the best way to detect encoder edges while homing?
> > >
> > > I wanted to offer methods for rising and falling.
> > >
> > > Thank you,
> > >
> > > Brad Murry
> > >
> >
>
Group: DynoMotion Message: 2730 From: bradodarb Date: 12/18/2011
Subject: Re: Master Homing Program
Hello Patrick,

I must have missed this one, sorry for the delayed response.


Kstep eh? Not the boards I' looking for? Very nice, it seems Dyno is going after the hobbyist stepper market with 'force'...

Actually with real closed loop steppers(instead of fault on position error limit only) I'd wager a stepper system + kflop is certainly not just for the hobby shop.


On the R/F::

So I think I understand what you are saying...

1 check initial state

2 if already at desired state, move until state changes

3 wait for desired state

Is that about right?

This way we would be more near the begining of the desired state instead of some random position in between states?


-Brad Murry
--- In DynoMotion@yahoogroups.com, "dynomotosaurus" <zenhacker@...> wrote:
>
>
> KStep? Camouflaged Links? [waves hand] "These are not the Boards you are
> looking for..."
>
> Regarding the Edge detection, isn't the while loop just looking for the
> configured input to be in the desired On/Off State? Meaning any time
> that code runs (regardless of edge transition) if the input is in the
> desired state the while loop will pass though to the next line even if
> it is still active from the previous while loop test.
>
> I did something similar in a different device (Machine Vision Smart
> Camera [PPT Impact]) where I needed to detect rising edge and falling
> edge transitions on regular boolean values set over Modbus (regular
> inputs had RE and FE event triggers, but Modbus Registers do not), I
> wanted a single output that was true for one execution pass but false on
> subsequent passes if the monitored input transitioned from false to
> true, and remained true. All I did was to replicate the functionality
> of the IEC 61131-3 R_Trig and F_Trig functions (which I use daily on PLC
> and other Motioncontroller systems we work with here).
>
> Basically you need an Input [Clk] (physical , or boolean variable) you
> want to monitor, an output [Q] (physical, or boolean variable), and a
> temporary boolean [LastClk] variable that can remember the previous
> Input state.
>
> R_Trig works like so...
> Q=Clk & (!LastClk);
> LastClk=Clk;
>
> F_Trig...
> Q=LastClk & (!Clk);
> LastClk=Clk;
>
> Granted the code as presented would require unique named Q/Clk/LastClk
> for each different Input and output state, but could be easily converted
> to function call where you pass the input/bool the desired index you
> want it assigned to, and a reference to an array of structures (if you
> want to maintain RE/FE states for multiple inputs). The array structure
> index would be used to reference the Q output for one shot execution in
> a flow control block (if/while, etc).
>
>
>
> Best Regards,
>
> Patrick
>
>
> --- In DynoMotion@yahoogroups.com, "bradodarb" <bradodarb@> wrote:
> >
> > haha
> >
> > Well he did try to keep "GetStopState" under wraps, so you just never
> know.
> >
> > Then there is the top secret KStep device that is camouflaged as a
> Kanalog.
> >
> > Makes you wonder whats really going on....
> >
> > -Brad
> >
> > --- In DynoMotion@yahoogroups.com, "himykabibble" jagboy@ wrote:
> > >
> > > Brad,
> > >
> > > "I wasn't sure if there were secret methods for it." - Even if there
> are, he won't be able to tell you - they're SECRET!!! :-)
> > >
> > > Regards,
> > > Ray L.
> > >
> > > --- In DynoMotion@yahoogroups.com, Brad Murry <bradodarb@> wrote:
> > > >
> > > > It’s just not natural for me that kflop/kanalog/snapamps
> handles encoders on it’s GPIO. I’m used to using separate
> methods for encoders on other controllers because most devices the IO is
> not fast enough.
> > > >
> > > >
> > > >
> > > > I wasn’t sure if there were secret methods for it.
> > > >
> > > >
> > > >
> > > > -Brad
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > From: DynoMotion@yahoogroups.com
> [mailto:DynoMotion@yahoogroups.com] On Behalf Of Tom Kerekes
> > > > Sent: Wednesday, December 07, 2011 3:35 PM
> > > > To: DynoMotion@yahoogroups.com
> > > > Subject: Re: [DynoMotion] Master Homing Program
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > Hi Brad,
> > > >
> > > >
> > > >
> > > > Not sure what you mean as I'm sure you know this but:
> > > >
> > > >
> > > >
> > > > int Polarity= 1; /// set to 1 to wait for a rising edge or 0 to
> wait for a falling edge
> > > >
> > > >
> > > >
> > > > while (ReadBit(xx) != Polarity) ; // wait for the desired polarity
> level
> > > >
> > > >
> > > >
> > > > Regards
> > > >
> > > > TK
> > > >
> > > >
> > > >
> > > > From: bradodarb <bradodarb@>
> > > > To: DynoMotion@yahoogroups.com
> > > > Sent: Wednesday, December 7, 2011 2:29 PM
> > > > Subject: [DynoMotion] Master Homing Program
> > > >
> > > >
> > > >
> > > > Hello Tom,
> > > >
> > > > What is the best way to detect encoder edges while homing?
> > > >
> > > > I wanted to offer methods for rising and falling.
> > > >
> > > > Thank you,
> > > >
> > > > Brad Murry
> > > >
> > >
> >
>